package com.sun.config;/**
 * @author sun
 * @date 2022/1/6 - 10:43
 */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;

/**
 * @description: JwtToken配置类
 * @author 孙
 * @date 2022/1/6 10:43
 * @version 1.0
 */
@Configuration
public class JwtTokenStoreConfig {

    @Bean
    public TokenStore JwtTokenStore(){
        return new JwtTokenStore(jwtAccessTokenConverter());
    }

    @Bean
    public JwtAccessTokenConverter jwtAccessTokenConverter(){
         JwtAccessTokenConverter accessTokenConverter = new JwtAccessTokenConverter();
         accessTokenConverter.setSigningKey("test_key");
         return accessTokenConverter;
    }
}
